local TinyGameLogin = {}

function TinyGameLogin:init()
    self.btnStart = nil;
    self.bg = nil;
end

function TinyGameLogin:onStart()
    self.btnStart = self:find("btnStart", CButton);
    self.bg = self:find("bg", Image);
    Utils.addClick(self.btnStart, function()
        Dispatcher:dispatch(EventType.TinyGame_Open);
    end);

    RedotMgr:registRedotType(RedotType.LoginBtnRedot, function()
        return true;
    end);
end

function TinyGameLogin:onShow()
    SoundMgr:playMusic("music", 0.3);
    self:addListener(RedotType.LoginBtnRedot, function(state)
        Utils.addRedotImage(self.btnStart, state);
    end);
    RedotMgr:updateRedot(RedotType.LoginBtnRedot);
end

function TinyGameLogin:onHide()

end

return ClassUtils:extends(TinyGameLogin, Panel);